package com.yoshino.strategy.improve;

/**
 * @author yoshino
 **/
public class Client {
    public static void main(String[] args) {
        WildDuck wildDuck = new WildDuck();
        wildDuck.fly();

        ToyDuck toyDuck = new ToyDuck();
        toyDuck.fly();

        PekingDuck pekingDuck = new PekingDuck();
        pekingDuck.fly();

        // 动态改动某个对象的行为
        pekingDuck.setFlyBehavior(new BadFlyBehavior());
        pekingDuck.fly();
    }
}
